package com.yenlien.traceyun.business.entity;

import com.yenlien.traceyun.webase.entity.BaseIdEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Objects;

/**
 * @author: bigwangy@sina.com
 * @create: 2020-12-21
 * @description:仓库分区
 **/

@Entity
@Table(name = "t_warehouse_part")
public class WarehousePart extends TraceEntity {

    @Column(name = "warehouse_id", length = 32)
    private String warehouseId;

    @Column(name = "name", length = 50)
    private String name;

    @Column(name = "code", length = 20)
    private String code;

    @Column(name = "base_soil_id", length = 32)
    private String baseSoilId;                  //关联基地的仓库外键

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getWarehouseId() {
        return warehouseId;
    }

    public void setWarehouseId(String warehouseId) {
        this.warehouseId = warehouseId;
    }


    public String getBaseSoilId() {
        return baseSoilId;
    }

    public void setBaseSoilId(String baseSoilId) {
        this.baseSoilId = baseSoilId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof WarehousePart)) return false;
        WarehousePart part = (WarehousePart) o;
        return warehouseId.equals(part.warehouseId) &&
                name.equals(part.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(warehouseId, name);
    }
}
